<div class="creative-create">
    <ol class="breadcrumb">
        <li>广告中心</li>
        <li><a class="tittle-color" ui-sref="campaigns" ui-sref-opts="{reload: true}">广告投放</a></li>
        <li><a class="tittle-color" ui-sref="campaigns.promotionGroup({campaignsId:$state.params.campaignsId})" ui-sref-opts="{reload: true}">广告推广组</a>
        </li>
        <li><a class="tittle-color" ui-sref="campaigns.promotionGroup.creatives" ui-sref-opts="{reload: true}">广告创意</a>
        </li>
        <li>广告创意修改</li>
    </ol>


    <form class="form-horizontal" name="mainForm" novalidate>
        <div class="fg-section">
            <h5>{{campaigns.title.adStyleName}}</h5>
            <div class="control-group">
                <label class="control-label form-require ">广告创意名称</label>
                <div class="controls">
                    <input type="text" placeholder="广告创意名称" ng-model="creativeToSave.creativeName" name="creativeName"
                           class="form-control" ng-blur="checkCreativeName()">
                    <span ng-if="!creativeToSave.creativeName&&submited" class="cl cr"><i class="fa fa-times error" aria-hidden="true"></i>不能为空</span>

                </div>
            </div>
            <div class="control-group">
                <label class="control-label form-require">广告点击</label>
                <div class="controls">
                    <label class="radio-label radio-inline ml-10">
                        <input type="radio" name="jumpType" value="67" ng-checked="creativeToSave.jumpType==67"   ng-model="creativeToSave.jumpType"  class="magic-radio" id="line">
                        <label for="line"></label>
                        <span class="ml-10">{{table[67]}}</span>
                    </label>
                    <label class="radio-label radio-inline">
                        <input type="radio" name="jumpType" value="68"  ng-checked="creativeToSave.jumpType==68"  ng-model="creativeToSave.jumpType"  class="magic-radio" id="phone"><label for="phone"></label><span class="ml-10">{{table[68]}}</span></label>
                    <label class="radio-label radio-inline">
                        <input type="radio" name="jumpType" value="69"  ng-checked="creativeToSave.jumpType==69"  ng-model="creativeToSave.jumpType"  class="magic-radio" id="message"><label for="message"></label><span class="ml-10">{{table[69]}}</span></label>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label form-require"></label>
                <div class="controls">
                    <input ng-show="creativeToSave.jumpType==68||creativeToSave.jumpType==69" type="text"
                           class="form-control" placeholder="电话" name="phone" ng-model="creativeToSave.phone"
                           maxlength="20" style="display: block">

                    <textarea ng-show="creativeToSave.jumpType==69" type="text" class="form-control mw-300"
                              placeholder="文本内容" name="message" ng-model="creativeToSave.message" maxlength="200">

                                </textarea>

                    <input type="text" class="form-control" placeholder="备用链接" name="webUrl"
                           ng-model="creativeToSave.webUrl" maxlength=500 >
                    <span ng-if="!creativeToSave.webUrl&&submited" class="cl cr"><i class="fa fa-times error" aria-hidden="true"></i>不能为空</span>

                </div>
            </div>
            <div class="mt-10">

            </div>
            <div class="control-group" ng-if="group.title.adStyleId==83" >
                <label class="control-label form-require">视频:</label>
                <div class="controls">
                    <div class="a-upload">
                        <input type="file" nv-file-select uploader="uploaderVedio" class="form-control mw-300"
                               multiple>选择
                    </div>
                    <span style="color:red" ng-if ="videoMsg">{{videoMsg}}</span>
                </div>
            </div>
            <div class="control-group" ng-if="group.title.adStyleId==81||group.title.adStyleId==82" >
                <label class="control-label form-require">图片</label>
                <div class="controls">
                    <div class="a-upload">
                        <input type="file" nv-file-select uploader="uploaderImage" class="form-control mw-300"
                                multiple>选择
                    </div>
                    <span style="color:red" ng-if ="imageMsg">{{imageMsg}}</span>
                </div>
            </div>
            <div class="control-group" ng-if="group.title.adStyleId==82||group.title.adStyleId==84" >
                <label class="control-label form-require">音频</label>
                <div class="controls">
                    <div class="a-upload">
                        <input type="file" nv-file-select uploader="uploaderAudio" class="form-control mw-300"
                                multiple>选择
                    </div>
                </div>
                <span style="color:red" ng-if ="audioMsg">{{audioMsg}}</span>
            </div>
            <div class="control-group">
                <label class="control-label form-require"></label>
                <div class="controls">
                    <span ng-if="!checkIsPass" style="color: red">请上传</span>

                </div>
            </div>


        </div>
        <div class="control-group dis-f"ng-if="uploaderImage.queue.length>0||uploaderVedio.queue.length>0||uploaderAudio.queue.length>0">
            <label class="control-label form-require col-sm-2"></label>
            <div class="controls col-sm-8 pl-0">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>文件名称</th>
                        <th>大小</th>
                        <th>进度</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in uploaderImage.queue">
                        <td><span class="first-td">{{item.file.name}}</span></td>
                        <td>{{ item.file.size/1024/1024|number:2 }} MB</td>
                        <td>
                            <uib-progressbar value="item.progress">{{item.progress}}%</uib-progressbar>

                        </td>
                        <td>
                            <i class="fa fa-trash" aria-hidden="true" style="color: red"
                               ng-click="item.remove();removeFile('image')"></i>

                        </td>
                    </tr>
                    <tr ng-repeat="item in uploaderAudio.queue">
                        <td><span class="first-td">{{item.file.name}}</span></td>
                        <td>{{ item.file.size/1024/1024|number:2 }} MB</td>
                        <td>
                            <uib-progressbar value="item.progress">{{item.progress}}%</uib-progressbar>

                        </td>
                        <td><i class="fa fa-trash" aria-hidden="true" style="color: red"
                               ng-click="item.remove();removeFile('media')" ;></i>
                        </td>
                    </tr>
                    <tr ng-repeat="item in uploaderVedio.queue">
                        <td><span class="first-td">{{item.file.name}}</span></td>
                        <td>{{ item.file.size/1024/1024|number:2 }} MB</td>
                        <td>
                            <uib-progressbar value="item.progress">{{item.progress}}%</uib-progressbar>

                        </td>
                        <td><i class="fa fa-trash" aria-hidden="true" style="color: red"
                               ng-click="item.remove();removeFile('media')"></i>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div class="a-upload" ng-click="uploadAll()">
                    <span>上传文件</span>
                </div>
            </div>
        </div>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <div class="text-center">
            <button type="button" class="btn btn-primary" ng-if="!creativeId"
                    ng-click="submit()">确定
            </button>
            <button type="button" class="btn btn-primary" ng-click="edit()" ng-if="creativeId">修改</button>
            <button type="button" class="btn ims-btn" ng-click="cancel()">取消</button>
        </div>

    </form>
</div>